import { Body, Controller, Get, Param, Post, UseInterceptors } from '@nestjs/common';
import { InternetService } from './internet.service';
import { ResInterceptor } from '../interceptor/res.interceptor';

@Controller('/industry')
@UseInterceptors(ResInterceptor)
export class InternetController {
    constructor(private readonly internetService: InternetService) {
    }

    // 获取新闻门户列表网站和api，动态生成
    @Get('/portals')
    getPortalList() {
        return [
            { name: '36Kr', api: '/kr36' },
            { name: '艾瑞咨询', api: '/airi' },
        ];
    }

    @Get('/kr36')
    async getKr36() {
        const res = await this.internetService.getKr36();
        return res;
    }

    @Get('/airi')
    async getAiri() {
        const res = await this.internetService.getAiri();
        return res;
    }

}
